<!--
  @author yangjiangming
  @date 2018-12-10 20:40:28
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html th:replace="~{work/modify/common/layout :: layout('优惠', ~{::title}, ~{::content}, ~{::script})}"
      xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <title>工单管理-特殊优惠</title>
</head>
<body>

<div th:fragment="content">
    <form action="" class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 80px">优惠券折扣</label>
            <th:block th:if="${#orderAuthPermit.checkPermit(moduleId,#orderPremissionConsts.ODP_HQ_BEAR_DISCOUNT)}">
                <input type="radio" name="discountBathId" lay-filter="discountBathId" lay-verify="required" th:value="${discountVO.hqDiscountBathId}"  title="总公司承担优惠"
                       th:checked="${discountVO.discountBathId == discountVO.hqDiscountBathId}">
            </th:block>
            <th:block th:if="${#orderAuthPermit.checkPermit(moduleId,#orderPremissionConsts.ODP_SUB_BEAR_DISCOUNT)}">
                <input type="radio" name="discountBathId" lay-filter="discountBathId" lay-verify="required" th:value="${discountVO.subDiscountBathId}" title="子公司承担优惠"
                       th:checked="${discountVO.discountBathId == discountVO.subDiscountBathId}">
            </th:block>

            <div class="layui-inline">
                <input
                        class="layui-input"
                        type="text"
                        name="discountAmount"
                        lay-verify="required|user-freediscount-number"
                        style="width: 200px"
                        th:value="${#moneyUtil.parseToYuan(discountVO.discountAmount)}"
                        th:readonly="${discountVO.discountAmount !=null}"
                        th:classappend="${discountVO.discountAmount !=null} ? 'layui-disabled'">
            </div>

            <div class="layui-inline"
                 th:if="${discountVO.discountAmount != null}" >
                <input type="checkbox"  lay-verify="required"  lay-skin="primary" name="removeDiscount" value="2" title="删除优惠">
            </div>
            <div class="layui-inline">
                优惠限制 0 ~ 9.9 折
            </div>
            <input type="hidden" name="operateId" th:value="${discountVO.operateId}">
            <input type="hidden" name="orderId" th:value="${discountVO.orderId}">
            <input type="hidden" name="workId" th:value="${discountVO.workId}">
            <input type="hidden" id="casSign" name="casSign" th:value="${casSign}"/>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 80px">缘由</label>
            <div class="layui-inline" style="width: 800px;">
                <textarea name="operatorRemark" class="layui-textarea" placeholder="请填写缘由，不超过1000字"></textarea>
                <div class="layui-form-item" style="text-align: center;margin-top: 20px;">
                    <div class="layui-inline">
                        <button class="layui-btn layui-bg-green" lay-submit="">保存</button>
                        <button class="layui-btn layui-btn-primary" type="reset">取消</button>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>

<script th:inline="javascript">

    var discountVO = [[${discountVO}]];
   var layuiModel={
        oms_work_modify_discount: "work/modify/zmn.oms.work.modify.discount"
    }
</script>
</body>
</html>